<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>属性 | eleTree2.0</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" type="image/png" href="/favicon.ico">
    <link rel="stylesheet" href="/eleTree/css/icon.css?v=2.2.12.1">
    <script src="/eleTree/eleTree.js?v=2.3.2.1"></script>
    <script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?7fcfe1e92263ed7399914905523c0c95";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();</script>
    <meta name="description" content="">
    <meta name="baidu-site-verification" content="IvAUSITvsn">
    <meta name="keywords" content="eleTree2.0在线文档">
    
    <link rel="preload" href="/assets/css/0.styles.aace74f1.css" as="style"><link rel="preload" href="/assets/js/app.480250c8.js" as="script"><link rel="preload" href="/assets/js/4.b0d5486a.js" as="script"><link rel="preload" href="/assets/js/41.857dbc9a.js" as="script"><link rel="prefetch" href="/assets/js/10.a0b1a881.js"><link rel="prefetch" href="/assets/js/11.38a905a5.js"><link rel="prefetch" href="/assets/js/12.283c4f32.js"><link rel="prefetch" href="/assets/js/13.b9d56332.js"><link rel="prefetch" href="/assets/js/14.73379bc3.js"><link rel="prefetch" href="/assets/js/15.7f1deca5.js"><link rel="prefetch" href="/assets/js/16.68f9f651.js"><link rel="prefetch" href="/assets/js/17.1936bb47.js"><link rel="prefetch" href="/assets/js/18.b9d2e7ea.js"><link rel="prefetch" href="/assets/js/19.47022793.js"><link rel="prefetch" href="/assets/js/20.840dae7e.js"><link rel="prefetch" href="/assets/js/21.05ca35b5.js"><link rel="prefetch" href="/assets/js/22.430b273e.js"><link rel="prefetch" href="/assets/js/23.bc776c15.js"><link rel="prefetch" href="/assets/js/24.d4738935.js"><link rel="prefetch" href="/assets/js/25.75456f05.js"><link rel="prefetch" href="/assets/js/26.db4e6df0.js"><link rel="prefetch" href="/assets/js/27.c8722d8b.js"><link rel="prefetch" href="/assets/js/28.596bb539.js"><link rel="prefetch" href="/assets/js/29.b284c5db.js"><link rel="prefetch" href="/assets/js/3.b77c06cc.js"><link rel="prefetch" href="/assets/js/30.7cf1dbee.js"><link rel="prefetch" href="/assets/js/31.3c57113a.js"><link rel="prefetch" href="/assets/js/32.82dc2e02.js"><link rel="prefetch" href="/assets/js/33.30ba126c.js"><link rel="prefetch" href="/assets/js/34.91729efe.js"><link rel="prefetch" href="/assets/js/35.2f8f329a.js"><link rel="prefetch" href="/assets/js/36.65394400.js"><link rel="prefetch" href="/assets/js/37.90ca698e.js"><link rel="prefetch" href="/assets/js/38.026f7dad.js"><link rel="prefetch" href="/assets/js/39.415e4ced.js"><link rel="prefetch" href="/assets/js/40.d57633b1.js"><link rel="prefetch" href="/assets/js/42.c849b4ba.js"><link rel="prefetch" href="/assets/js/43.ccc6eb23.js"><link rel="prefetch" href="/assets/js/5.31af0348.js"><link rel="prefetch" href="/assets/js/6.cc7f3865.js"><link rel="prefetch" href="/assets/js/7.56874f53.js"><link rel="prefetch" href="/assets/js/8.7615c930.js"><link rel="prefetch" href="/assets/js/9.6eb8268c.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.b0b0b3af.js">
    <link rel="stylesheet" href="/assets/css/0.styles.aace74f1.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">eleTree2.0</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="/eleTree/installation.html" class="nav-link">
  eleTree2.0
</a></div><div class="nav-item"><a href="https://layuiextend.hsianglee.cn/eleTree/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  1.0版本
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/hsiangleev/eleTree" target="_blank" rel="noopener noreferrer" class="nav-link external">
  github
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://hsianglee.cn" target="_blank" rel="noopener noreferrer" class="nav-link external">
  个人博客
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/eleTree/installation.html" class="nav-link">
  eleTree2.0
</a></div><div class="nav-item"><a href="https://layuiextend.hsianglee.cn/eleTree/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  1.0版本
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/hsiangleev/eleTree" target="_blank" rel="noopener noreferrer" class="nav-link external">
  github
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://hsianglee.cn" target="_blank" rel="noopener noreferrer" class="nav-link external">
  个人博客
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <div class="advertise-top"><script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins data-ad-client="ca-pub-2229355551485035" data-ad-slot="6395441907" class="adsbygoogle" style="display:inline-block;width:210px;height:100px"></ins> <script>
        (adsbygoogle = window.adsbygoogle || []).push({});
    </script></div> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>开发指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/eleTree/installation.html" class="sidebar-link">安装</a></li><li><a href="/eleTree/quickstart.html" class="sidebar-link">快速开始</a></li><li><a href="/eleTree/update-log.html" class="sidebar-link">更新日志</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>使用文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/eleTree/usedocs-attr.html" aria-current="page" class="active sidebar-link">属性</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/eleTree/usedocs-methods.html" class="sidebar-link">方法</a></li><li><a href="/eleTree/usedocs-event.html" class="sidebar-link">事件</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>示例</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/eleTree/demo-methods.html" class="sidebar-link">方法示例</a></li><li><a href="/eleTree/demo-icon.html" class="sidebar-link">自定义图标或图片</a></li><li><a href="/eleTree/demo-customText.html" class="sidebar-link">文本节点自定义</a></li><li><a href="/eleTree/demo-datatype.html" class="sidebar-link">pid结构的数据格式</a></li><li><a href="/eleTree/demo-rightmenu.html" class="sidebar-link">右键菜单</a></li><li><a href="/eleTree/demo-drag.html" class="sidebar-link">节点拖拽</a></li><li><a href="/eleTree/demo-lazyload.html" class="sidebar-link">懒加载</a></li><li><a href="/eleTree/demo-search.html" class="sidebar-link">树节点搜索</a></li><li><a href="/eleTree/demo-manydata.html" class="sidebar-link">大数据量渲染</a></li><li><a href="/eleTree/demo-sort.html" class="sidebar-link">树节点排序</a></li><li><a href="/eleTree/explain.html" class="sidebar-link">规则说明</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h3 id="属性"><a href="#属性" class="header-anchor">#</a> 属性</h3> <h4 id="基础属性"><a href="#基础属性" class="header-anchor">#</a> 基础属性</h4> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>el</td> <td>dom选择器</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>data</td> <td>静态数据</td> <td>array</td> <td>—</td> <td>—</td></tr> <tr><td>emptText</td> <td>当数据为空时显示的内容</td> <td>string</td> <td>—</td> <td>暂无数据</td></tr> <tr><td>highlightCurrent</td> <td>是否高亮当前选中节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>highlightNode</td> <td>初始高亮选中的key</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>defaultExpandAll</td> <td>是否默认展开所有节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>autoExpandParent</td> <td>展开子节点的时候是否自动展开父节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>expandOnClickNode</td> <td>是否在点击文本的时候展开或者收缩节点，如果为 false，则只有点箭头图标的时候才会展开或者收缩节点</td> <td>boolean</td> <td>—</td> <td>true</td></tr> <tr><td>checkOnClickNode</td> <td>复选框是否在点击文本的时候选中节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>radioOnClickNode</td> <td>单选框是否在点击文本的时候选中节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>defaultExpandedKeys</td> <td>默认展开的节点的 key 的数组</td> <td>array</td> <td>—</td> <td>—</td></tr> <tr><td>showCheckbox</td> <td>是否显示checkbox</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>checkStrictly</td> <td>在显示复选框的情况下，是否严格的遵循父子不互相关联的做法</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>isDefaultChangePstatus</td> <td>在显示复选框并且父子关联的情况下，初始数据是否只是子节点影响父节点，默认false，即父子关联</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>defaultCheckedKeys</td> <td>默认勾选的节点的 key 的数组</td> <td>array</td> <td>—</td> <td>—</td></tr> <tr><td>accordion</td> <td>是否每次只打开一个同级树节点展开（手风琴效果）</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>indent</td> <td>相邻级节点间的水平缩进，单位为像素</td> <td>number</td> <td>—</td> <td>16</td></tr> <tr><td>showLine</td> <td>是否显示虚线</td> <td>boolean</td> <td>—</td> <td>true</td></tr> <tr><td>imgUrl</td> <td>图片所在的文件夹路径</td> <td>string</td> <td>—</td> <td>./images/</td></tr> <tr><td>icon</td> <td>使用自定义图标或图片(全局)</td> <td>object</td> <td>fold，leaf，checkFull，checkHalf，checkNone，dropdownOff，dropdownOn，loading，radioCheck，radioCheckNone</td> <td>每个属性默认值均为空字符串</td></tr> <tr><td>iconItem</td> <td>自定义图标(单独设置某一个节点)</td> <td>function</td> <td>null</td> <td></td></tr> <tr><td>done</td> <td>树渲染完成之后的回调，参数当异步时为后台返回数据，静态数据为{data: ...}</td> <td>function</td> <td>—</td> <td>—</td></tr> <tr><td>lazy</td> <td>开启懒加载</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>rightMenuList</td> <td>开启右键菜单</td> <td>array/function</td> <td>&quot;copy&quot;, &quot;paste&quot;, &quot;paste_before&quot;, &quot;paste_after&quot;, &quot;cut_paste&quot;, &quot;edit&quot;, &quot;remove&quot;, &quot;add_child&quot;, &quot;add_before&quot;, &quot;add_after&quot;</td> <td>[]</td></tr> <tr><td>showRadio</td> <td>是否显示radio</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>radioType</td> <td>单选范围（是同一级还是整体只能选择一个）</td> <td>string</td> <td>level/all</td> <td>level</td></tr> <tr><td>defaultRadioCheckedKeys</td> <td>radio默认选中项</td> <td>array</td> <td>—</td> <td>—</td></tr> <tr><td>isOnlyShowLeafRadio</td> <td>当显示radio的时候是否只显示叶子节点</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>defaultPid</td> <td>当使用pid格式的数据时，第一层数据的默认值</td> <td>string/number</td> <td>—</td> <td>''</td></tr> <tr><td>draggable</td> <td>是否开启拖拽节点功能</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>customText</td> <td>节点文本自定义函数；<a href="/eleTree/demo-customText.html">查看更多</a></td> <td>function</td> <td>—</td> <td>—</td></tr> <tr><td>sort</td> <td>是否开启排序；<a href="/eleTree/demo-sort.html">查看更多</a></td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>initSort</td> <td>节点排序传入的控制参数</td> <td>object</td> <td>id:对某一个节点排序, 不传则对最外层节点;field:按某个字段排序;type:升序asc降序desc;depth:深度,不传则为所有子节点</td> <td>—</td></tr></tbody></table> <h4 id="异步属性"><a href="#异步属性" class="header-anchor">#</a> 异步属性</h4> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>url</td> <td>异步接口地址</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>method</td> <td>接口http请求类型</td> <td>string</td> <td>get,post</td> <td>get</td></tr> <tr><td>where</td> <td>接口的其它参数</td> <td>object</td> <td>—</td> <td>—</td></tr> <tr><td>headers</td> <td>接口的请求头</td> <td>object</td> <td>—</td> <td>—</td></tr> <tr><td>response</td> <td>dom选择器</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>request</td> <td>dom选择器</td> <td>string</td> <td>—</td> <td>—</td></tr></tbody></table> <h4 id="默认配置"><a href="#默认配置" class="header-anchor">#</a> 默认配置</h4> <div class="language-javascript line-numbers-mode"><pre class="language-javascript"><code><span class="token punctuation">{</span>
    <span class="token literal-property property">el</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>                   <span class="token comment">// dom选择器</span>
    <span class="token literal-property property">data</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>                   <span class="token comment">// 静态数据</span>
    <span class="token literal-property property">emptText</span><span class="token operator">:</span> <span class="token string">&quot;暂无数据&quot;</span><span class="token punctuation">,</span>        <span class="token comment">// 内容为空的时候展示的文本</span>
    <span class="token literal-property property">highlightCurrent</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>    <span class="token comment">// 是否高亮当前选中节点，默认值是 false。  </span>
    <span class="token literal-property property">highlightNode</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>          <span class="token comment">// 初始高亮选中的key     </span>
    <span class="token literal-property property">defaultExpandAll</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>    <span class="token comment">// 是否默认展开所有节点                         </span>
    <span class="token literal-property property">expandOnClickNode</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>    <span class="token comment">// 是否在点击文本的时候展开或者收缩节点， 默认值为 true，如果为 false，则只有点箭头图标的时候才会展开或者收缩节点。</span>
    <span class="token literal-property property">checkOnClickNode</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>    <span class="token comment">// 复选框是否在点击文本的时候选中节点，默认值为 false，即只有在点击复选框时才会选中节点。</span>
    <span class="token literal-property property">radioOnClickNode</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>    <span class="token comment">// 单选框是否在点击文本的时候选中节点，默认值为 false，即只有在点击单选框时才会选中节点。</span>
    <span class="token literal-property property">defaultExpandedKeys</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>    <span class="token comment">// 默认展开的节点的 key 的数组 </span>
    <span class="token literal-property property">autoExpandParent</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>     <span class="token comment">// 展开子节点的时候是否自动展开父节点 </span>
    <span class="token literal-property property">showCheckbox</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>        <span class="token comment">// 节点是否可被选择 </span>
    <span class="token literal-property property">checkStrictly</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>       <span class="token comment">// 在显示复选框的情况下，是否严格的遵循父子不互相关联的做法，默认为 false  </span>
    <span class="token literal-property property">isDefaultChangePstatus</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>      <span class="token comment">// 在父子关联的情况下，初始数据是否只是子节点影响父节点，即父节点选中，子节点全部没有选中或部分选中，则让父节点也没有选中或者半选，默认false，即父子结点互相影响</span>
    <span class="token literal-property property">defaultCheckedKeys</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>     <span class="token comment">// 默认勾选的节点的 key 的数组  </span>
    <span class="token literal-property property">accordion</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>           <span class="token comment">// 是否每次只打开一个同级树节点展开（手风琴效果）  </span>
    <span class="token literal-property property">indent</span><span class="token operator">:</span> <span class="token number">16</span><span class="token punctuation">,</span>                 <span class="token comment">// 相邻级节点间的水平缩进，单位为像素           </span>
    <span class="token literal-property property">lazy</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>                <span class="token comment">// 当不是懒加载时，叶子节点由当前节点是否由子节点判断，如果为懒加载，则叶子节点由当前节点的属性isLeaf: true决定</span>
    <span class="token function-variable function">load</span><span class="token operator">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>        <span class="token comment">// 加载子树数据的方法，仅当 lazy 属性为true 时生效</span>
    <span class="token literal-property property">draggable</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>           <span class="token comment">// 是否开启拖拽节点功能</span>
    <span class="token literal-property property">searchNodeMethod</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>     <span class="token comment">// 对树节点进行筛选时执行的方法，返回 true 表示这个节点可以显示，返回 false 则表示这个节点会被隐藏</span>
    <span class="token literal-property property">showLine</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>             <span class="token comment">// 是否显示连线，默认true</span>
    <span class="token literal-property property">imgUrl</span><span class="token operator">:</span> <span class="token string">&quot;./images/&quot;</span><span class="token punctuation">,</span>        <span class="token comment">// 图片所在的文件夹路径   </span>
    <span class="token literal-property property">icon</span><span class="token operator">:</span> <span class="token punctuation">{</span>                     <span class="token comment">// 自定义图标(全局)</span>
        <span class="token literal-property property">fold</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">leaf</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">checkFull</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">checkHalf</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">checkNone</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">dropdownOff</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">dropdownOn</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">loading</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">radioCheck</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">radioCheckNone</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token literal-property property">iconItem</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>             <span class="token comment">// 自定义图标(单独设置某一个节点)</span>
    <span class="token literal-property property">rightMenuList</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>          <span class="token comment">// 右键菜单(&quot;copy&quot;, &quot;paste&quot;, &quot;paste_before&quot;, &quot;paste_after&quot;, &quot;cut_paste&quot;, &quot;edit&quot;, &quot;remove&quot;, &quot;add_child&quot;, &quot;add_before&quot;, &quot;add_after&quot;)</span>
    <span class="token literal-property property">done</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>         <span class="token comment">// 树渲染完成之后的回调</span>
    <span class="token literal-property property">showRadio</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>               <span class="token comment">// 是否显示radio</span>
    <span class="token literal-property property">radioType</span><span class="token operator">:</span> <span class="token string">&quot;level&quot;</span><span class="token punctuation">,</span> <span class="token comment">// all      // 单选范围（是同一级还是整体只能选择一个）</span>
    <span class="token literal-property property">isOnlyShowLeafRadio</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>     <span class="token comment">// 是否只显示叶子节点的radio</span>
    <span class="token literal-property property">defaultRadioCheckedKeys</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>    <span class="token comment">// radio默认选中项</span>
    <span class="token literal-property property">customText</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>               <span class="token comment">// 节点文本自定义函数</span>

    <span class="token literal-property property">method</span><span class="token operator">:</span> <span class="token string">&quot;get&quot;</span><span class="token punctuation">,</span>      <span class="token comment">// 接口http请求类型</span>
    <span class="token literal-property property">url</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>            <span class="token comment">// 异步接口地址</span>
    <span class="token literal-property property">where</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>          <span class="token comment">// 接口的其它参数</span>
    <span class="token literal-property property">headers</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>        <span class="token comment">// 接口的请求头</span>
    <span class="token literal-property property">response</span><span class="token operator">:</span> <span class="token punctuation">{</span>         <span class="token comment">// 对后台返回的数据格式重新定义</span>
        <span class="token literal-property property">statusName</span><span class="token operator">:</span> <span class="token string">&quot;code&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">statusCode</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
        <span class="token literal-property property">dataName</span><span class="token operator">:</span> <span class="token string">&quot;data&quot;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token literal-property property">defaultPid</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>     <span class="token comment">// 第一层pid的初始值</span>
    <span class="token literal-property property">request</span><span class="token operator">:</span> <span class="token punctuation">{</span>          <span class="token comment">// 对于后台数据重新定义名字</span>
        <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">&quot;label&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">key</span><span class="token operator">:</span> <span class="token string">&quot;id&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token string">&quot;children&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">disabled</span><span class="token operator">:</span> <span class="token string">&quot;disabled&quot;</span><span class="token punctuation">,</span>       <span class="token comment">// 被禁用的节点不会影响父子节点的选中状态</span>
        <span class="token literal-property property">checked</span><span class="token operator">:</span> <span class="token string">&quot;checked&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">isOpen</span><span class="token operator">:</span> <span class="token string">&quot;isOpen&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">isLeaf</span><span class="token operator">:</span> <span class="token string">&quot;isLeaf&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">pid</span><span class="token operator">:</span> <span class="token string">&quot;pid&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">radioChecked</span><span class="token operator">:</span> <span class="token string">&quot;radioChecked&quot;</span><span class="token punctuation">,</span>
        <span class="token literal-property property">radioDisabled</span><span class="token operator">:</span> <span class="token string">&quot;radioDisabled&quot;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token literal-property property">sort</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>            <span class="token comment">// 是否开启排序，开启则使用initSort参数（对于懒加载，如果开启排序，并且不传深度，则执行排序，如果传深度，需要手动执行sort方法）</span>
    <span class="token literal-property property">initSort</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>           <span class="token comment">// 对某一个节点排序, 不传则对最外层节点</span>
        <span class="token literal-property property">field</span><span class="token operator">:</span> <span class="token string">&quot;label&quot;</span><span class="token punctuation">,</span>     <span class="token comment">// 按某个字段排序</span>
        <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">&quot;asc&quot;</span><span class="token punctuation">,</span>        <span class="token comment">// asc:升序, desc:降序 </span>
        <span class="token literal-property property">depth</span><span class="token operator">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span>        <span class="token comment">// 深度，不传则为最深层，支持数字，1/2/3</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br></div></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">11/24/2021, 5:20:18 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/eleTree/update-log.html" class="prev">
        更新日志
      </a></span> <span class="next"><a href="/eleTree/usedocs-methods.html">
        方法
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.480250c8.js" defer></script><script src="/assets/js/4.b0d5486a.js" defer></script><script src="/assets/js/41.857dbc9a.js" defer></script>
  </body>
</html>
